// mock数据模拟
import Mock from 'mockjs';

// 图表数据
export default {
  getStatisticalData: () => {
    let List = [];
    // Mock.Random.float 产生随机数100~8000之间，保留小数，最小0位，最大0位
    for (let i = 0; i < 7; i++) {
      List.push(
        Mock.mock({
          oppo: Mock.Random.float(100, 800, 0, 0),
          vivo: Mock.Random.float(100, 800, 0, 0),
          苹果: Mock.Random.float(100, 800, 0, 0),
          小米: Mock.Random.float(100, 800, 0, 0),
          三星: Mock.Random.float(100, 800, 0, 0),
          魅族: Mock.Random.float(100, 800, 0, 0),
          黑鲨: Mock.Random.float(100, 800, 0, 0),
          华为: Mock.Random.float(100, 800, 0, 0),
        })
      );
    }
    return {
      code: 20000,
      data: {
        // 饼图
        videoData: [
          {
            name: 'oppo',
            value: 1999,
          },
          {
            name: 'vivo',
            value: 1999,
          },
          {
            name: '苹果',
            value: 5999,
          },
          {
            name: '小米',
            value: 2999,
          },
          {
            name: '三星',
            value: 3999,
          },
          {
            name: '魅族',
            value: 2299,
          },
          {
            name: '黑鲨',
            value: 2999,
          },
          {
            name: '华为',
            value: 4999,
          },
        ],
        // 柱状图
        userData: [
          {
            data: '周一',
            new: 5,
            active: 200,
          },
          {
            data: '周二',
            new: 10,
            active: 500,
          },
          {
            data: '周三',
            new: 15,
            active: 300,
          },
          {
            data: '周四',
            new: 9,
            active: 450,
          },
          {
            data: '周五',
            new: 50,
            active: 550,
          },
          {
            data: '周六',
            new: 80,
            active: 800,
          },
          {
            data: '周日',
            new: 60,
            active: 640,
          },
        ],
        // 折线图
        orderData: {
          date: [
            '20191001',
            '20191002',
            '20191003',
            '20191004',
            '20191005',
            '20191006',
            '20191007',
          ],
          data: List,
        },
        tableData: [
          {
            name: 'oppo',
            todayBuy: 500,
            monthBuy: 3500,
            totalBuy: 22000,
          },
          {
            name: 'vivo',
            todayBuy: 300,
            monthBuy: 2200,
            totalBuy: 14000,
          },
          {
            name: '苹果',
            todayBuy: 800,
            monthBuy: 4500,
            totalBuy: 65000,
          },
          {
            name: '小米',
            todayBuy: 900,
            monthBuy: 7000,
            totalBuy: 65500,
          },
          {
            name: '三星',
            todayBuy: 170,
            monthBuy: 1350,
            totalBuy: 3800,
          },
          {
            name: '魅族',
            todayBuy: 100,
            monthBuy: 800,
            totalBuy: 2600,
          },
          {
            name: '黑鲨',
            todayBuy: 260,
            monthBuy: 950,
            totalBuy: 29000,
          },
          {
            name: '华为',
            todayBuy: 300,
            monthBuy: 1250,
            totalBuy: 96600,
          },
        ],
      },
    };
  },
};
